<?php 

$this->headScript()
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.core.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.widget.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.button.js");
$this->headLink()->appendStylesheet($this->baseUrl(). '/js/jquery/development-bundle/themes/ui-lightness/jquery.ui.all.css');
$this->headTitle('Impuestos');
?>
<div class="section table_section">
<div class="section_inner">
	<div class="title_wrapper">
		<h2 id="title-section">Impuestos</h2>
	</div>
	<div class="section_content">
	<p class="errorText">&nbsp;<?php echo $this->messageError; ?></p>
	<div  id="product_list">
	<!--[if !IE]>start table_wrapper<![endif]-->
	<div class="table_wrapper">
		<div class="table_wrapper_inner">
		
                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                <tbody>
                	<tr>
		              	<th width="20" align="right">ID</td>
		                <th width="400" align="left">Impuesto</td>
		                <th width="400" align="left">Porcentaje</td>
		                <th align="right">Acción&nbsp;</td>
              		</tr>
              
		<?php 

			foreach ($this->Taxes AS $dat){
		?>
		
              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >
                <td width="20" align="right"><?php echo $dat['Id'];?></td>
                <td valign="middle">
                	<a class="product_name" href="<?php echo $this->baseUrl(); ?>/admin/taxes/add/?Id=<?php echo $dat['Id'];?>">
                		<?php echo (isset($dat['Name'])) ? $dat['Name'] : '&nbsp;&nbsp;'; ?>
					</a>
                </td>
                <td align="center" valign="middle"><?php echo (isset($dat['Percent'])) ? $dat['Percent'] : '&nbsp;&nbsp;'; ?>%</td>                
                <td align="right">
                <div class="actions_menu">
						<ul>
							<li><a class="edit" href="<?php echo $this->baseUrl(); ?>/admin/taxes/add/Id/<?php echo $dat['Id'];?>/">editar</a></li>
							<li><a class="delete delete-alert" href="<?php echo $this->baseUrl(); ?>/admin/taxes/delete/Id/<?php echo $dat['Id'];?>/">
								Eliminar</a>
							</li>
						</ul>
				</div>
					
               </td>
              </tr>
              
<?php 		}
		
?>              
        </table>
        </div>
        
</div>
	<!--[if !IE]>end table_wrapper<![endif]-->
	</div>
	
<?php echo $this->paginationControl($this->Taxes, 'Sliding', 'pagination.phtml'); ?>
			
		</div>
	</div>        

<script type="text/javascript">
$(document).ready(function(){
	$( "#addtaxe" ).button();
	$("a.delete-alert").click(function(){
		
		if(confirm("Realmente desea eliminar este impuesto?, tenga encuenta que este proceso será irreversible")){
			return true;
		}
	
		return false;
	});
	
});
</script>
<div style="width:100%; text-align: right;">
<p>
	<a href="<?php echo $this->baseUrl(); ?>/admin/taxes/add/" id="addtaxe">Agregar Impuesto</a>
</p>
</div>

</div>

